home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / netmail / gigo0524.zip / DOS4GW.DOC < prev    next >
Text File  |  1994-01-14  |  18KB  |  387 lines

  1. DOS/4GW Protected Mode Run-time  Version 1.92
  2. Copyright (c) Rational Systems, Inc. 1990-1993
  3.  
  4. Many programs in use today are already using DOS/4G; some
  5. examples are GIGO, GoldEd, BlueWave, Doom,   More are sure to follow,
  6. as it's popularity quickly increases.
  7.  
  8. This specific version is only for use by progams compiled
  9. with Watcom C/C++ 32-bit compilers.  This archive is being made
  10. available so as to eliminate the need to bundle it with every package
  11. that is distributed.  It's a big file!
  12.  
  13. Note that this documentation is not authorized or acknowledged by
  14. anyone; it is merely provided as a common referece for the product.  It
  15. refers to how to configure it's memory usage, as well as information on
  16. the virtual memory manager.  (Yes, this DOS extender will emulate
  17. memory directly!).
  18.  
  19.  
  20. This document is in two parts:
  21. "Configuring DOS/4GW"     (Watcom C/C++32 User's Guide Chapter 19)
  22. "VMM"                     (Watcom C/C++32 User's Guide Chapter 20)
  23.  
  24. ---------------------------------------------------------------------
  25. "Configuring DOS/4GW"     (Watcom C/C++32 User's Guide Chapter 19)
  26.  
  27.   This chapter explains how to use the DOS4G environment variable to
  28.   suppress the banner that is displayed by DOS/4GW at startup.  It also
  29.   explains how to use the DOS16M envirnonment variable to slect the
  30.   switch mode setting, if neccesary, and to specify the range of extended
  31.   memory in which DOS/4GW will operate.  DOS/4GW is based on Rational
  32.   Systems' DOS/16M 16-bit Protected-Mode support; hence the DOS16M
  33.   environment variable name remains unchanged.
  34.  
  35. SUPPRESSING THE DOS/4GW BANNER
  36.  
  37.   The banner that is displayed by DOS/4GW at startup can be suppressed by
  38.   issuing the following command:
  39.  
  40.       SET DOS4G=QUIET
  41.  
  42.   Do not insert a space between the DOS4G and the equal sign.  A space to
  43.   the right of the equal sign is optional.
  44.  
  45. CHANGING THE SWITCH MODE SETTING
  46.  
  47.   In almost all cases, DOS/4GW programs can detect the type of machine
  48.   that is running and automatically choose an appropriate
  49.   real-to-protected moe switch technique.  For the few cases in which
  50.   this default setting does not work we provide the DOS16M DOS
  51.   environment variable, which overrides the default setting.
  52.  
  53.   Change the swtich mode settings by issuing the following command:
  54.  
  55.       SET DOS16M=value
  56.  
  57.   Do not insert a space between the DOS16M and the equal sign.  A space
  58.   to the right of the equal sign is optional.
  59.  
  60.   The table below lists the machines and the settings you would use with
  61.   them.  Many settings have mnemomics,  listed in the column "Alternate
  62.   Name," that you can use instead of the number.  Settings that you must
  63.   set with the DOS16M variable have the notation _req'd_ in the first
  64.   column.  Settings you may use are marked _option_, and settings that
  65.   will automatically be set are marked _auto_.
  66.  
  67. Status  Machine         Setting Alt     Comment
  68.  
  69.   auto  386/486 w/DPMI  0       None    Set automatically if DPMI is active
  70.   req'd NEC 98-series   1       9801    Must be set for NEC 98-series
  71.   auto  PS/2            2       None    Set automatically for PS/2
  72.   auto  386/486         3       386     Set automatically for 386 or 486
  73.   auto  386             INBOURD None    386 with Intel Inboard
  74.   req'd Fujitsu FMR-70  5       None    Must be set for Fujitsu FMR-70
  75.   auto  386/486 w/VCPI  11      None    Set automatically if VCPI detected
  76.   req'd Hitachi B32     14      None    Must be set for Hitachi B32
  77.   req'd OKI if800       15      None    Must be set for OKI if800
  78.  option IBM PS/55       16      None    May be needed for some PS/55s
  79.  
  80.   The following procedure shows you how to test the switch mode setting.
  81.  
  82.   1.  If you have one of machines listed below, set the DOS16M
  83.       environment variable to teh value shown for that machine and
  84.       specify a range of extended memory.  For example, if your machine
  85.       is an NEC 98-series, set DOS16M=1 @2M-4M.  See the section, "Fine
  86.       Control of Memory Usage" later in this chapter for more
  87.       information about setting the memory range.
  88.  
  89.       Machine                   Setting
  90.       NEC 98-series             1
  91.       Fujitsu FMR 60,70         5
  92.       Hitachi B32               14
  93.       OKI if800                 15
  94.  
  95.       Before running DOS/4GW applications, check the switch mode
  96.       setting by following this procedure:
  97.  
  98.   2.  Run PMINFO and note the switch setting reported on the last line
  99.       of the display.  (PMINFO, which reports on the protected-mode
  100.       resources available to your programs, is described in more detail
  101.       in the chapeter, "Utilities".)
  102.  
  103.       If PMINFO runs, the setting is usable on your machine.
  104.  
  105.   3.  If you changed the switch setting, add the new setting to your
  106.       AUTOEXEC.BAT file.
  107.  
  108.   NOTE:  PMFINFO will run successfully on 286 machines.  If your
  109.   DOS/4GW application does not run, and PMINFO does, check the CPU type
  110.   reported on the first line of the display.
  111.  
  112.   You are authorized (and encouraged) to distribute PMINFO to your
  113.   customers.  You may also include a copy of this section in your
  114.   documentation.
  115.  
  116. FINE CONTROL OF MEMORY USAGE
  117.  
  118.   In addition to setting the switch mode as described above, the DOS16M
  119.   environment variable enables you to specify which portion of extended
  120.   memory DOS/4GW will use.  The variable also allows you to instruct
  121.   DOS/4GW to search for extra memory and use it if it is present.
  122.  
  123.   SPECIFYING A RANGE OF EXTENDED MORY
  124.  
  125.   Normally, you don't need to specify a range of memory with the
  126.   DOS16M variable.  You must use the variable, however, in the
  127.   following cases:
  128.  
  129.       o  You are running on a Fujitsu FMR-series, NEC 98-series, OKI
  130.          if800-series, or Hitachi B-series machine.
  131.       o  You have older programs that use extended memory but don't
  132.          follow one of the standard disciplines.
  133.       o  You want to shell out of DOS/4GW to use another program that
  134.          requires extended memory.
  135.  
  136.   If none of these conditions applies to you, you can skip this
  137.   section.
  138.  
  139.   The general syntax is
  140.  
  141.       SET DOS16M= [switch_mode] [@start_address] [-end_address] [:size]
  142.  
  143.   In the syntax shown above, start_address, end_address, and size
  144.   represent numbers, expressed in decimal or hexadecimal (hex requires
  145.   0x prefix).  The number may end with a K to indicate an address or
  146.   size in kilobytes, or an M to indicate megabytes.  If no suffix is
  147.   given, the address or size is assumed to be in kilobytes.  IF both a
  148.   size and a range are specified, the more restrictive interpretation
  149.   is used.
  150.  
  151.   The most flexible strategy is to specify only a size.  However, if
  152.   you are running with other software that does not follow a
  153.   convention for indicating its use of extended memory, and these
  154.   other programs start before DOS/4GW, you will need to calculate the
  155.   range of memory used by the other programs and specify a range for
  156.   DOS/4GW programs to use.
  157.  
  158.   DOS/4GW ignores specifications  (or parts of specifications) that
  159.   conflict with other information about extended memory use.  Below
  160.   are some examples of memory usage control:
  161.  
  162.   set DOS16M=1 @2m-4m      Mode 1, for NEC 98-series machines, and use
  163.                            extended memory between 2.0 and 4.0 MB
  164.   set DOS16M=:1M           Use the last megabyte of extended memory,
  165.                            or as much available limited to 1MB.
  166.   set DOS16M=@2m           Use any extended memory available above 2MB
  167.   set DOS16M=@0-5m         Use any availaable extended memory from 0.0
  168.                            (really 1.0) to 5.0 MB
  169.   set DOS16M=:0            Use no extended memory
  170.  
  171.   As a default condition DOS/4GW applications take all extended memory
  172.   that is not otherwise in use.  Multiple DOS/4GW programs that
  173.   execute simultaneously will share the reserved range of extended
  174.   memory.  Any non-DOS/4GW programs started while DOS/4GW programs are
  175.   executing will find that extended memory above the start of DOS/4GW
  176.   range is unavailable, so they may not be able to run.  This is very
  177.   safe.  There will be a conflict only if the other program does not
  178.   check the BIOS configuration call (Interrupt 15H function 88H, get
  179.   extended memory size).
  180.  
  181.   To create a private pool of extended memory for your DOS/4GW
  182.   application, use the PRIVATXM program, described in the chapter,
  183.   "Utilities."
  184.  
  185.   The default memory allocation stragegy is to use extended memory if
  186.   available, and overflow into DOS (low) memory.
  187.  
  188.   If a VCPI or DPMI environment, the start_address and end_address
  189.   arguments are not meaningful.  DOS/4GW memory under these protocals
  190.   is not allocated according to specific addresses because VCPI and
  191.   DPMI automatically prevent address conflicts betwen extended memory
  192.   programs.  You may specify a size for memory manged by VCPI or DPMI,
  193.   but DOS/4GW will not necessarily allocate this memory from the
  194.   highest available extended memory address, as it does for memory
  195.   managed under other protocals.
  196.  
  197.   USING EXTRA MEMORY
  198.  
  199.   Some machines contain extra non-extended, non-conventional memory
  200.   just below 16MB.  When DOS/4GW runs on a Compaq 386, it automaticly
  201.   uses this memory because the memory is allocated according to a
  202.   certain protocal, which DOS/4GW follows.  Other machines have no
  203.   protocal for allocating this memory.  To use the extra memory that
  204.   may exist on these machines, set DOS16M with the + option.
  205.  
  206.       set DOS16M=+
  207.  
  208.   Setting the + option causes DOS/4GW to search for memory in the
  209.   range from FA0000 to FFFFFF and determine whether the memory is
  210.   usable.  DOS/4GW does this by writing into the extra memory and
  211.   reading what it has written.  In some cases, this memory is mapped
  212.   for DOS or BIOS usage, or for other system uses.  If DOS/4GW finds
  213.   extra memory that is mapped this way, nad is not marked read-only,
  214.   it will write into that memory.  This will cause a crash, but won't
  215.   have any other effect on your system.
  216.  
  217. SETTING RUNTIME OPTIONS
  218.  
  219.    The DOS16M environment variable sets certian runtime options for all
  220.    DOS/4GW programs running on the same system.
  221.  
  222.    To set the environment variable, the syntax is:
  223.  
  224.        set DOS16M=[switch_mode_settings] ^options
  225.  
  226.    Note: Some command line editing TSR's, such as CED, use the caret
  227.    (^) as a delimiter.  If you want to set DOS16M using the syntax
  228.    above while one of these TSR's is redident, modify the TSR to use a
  229.    different delimiter.
  230.  
  231.    These are the options:
  232.  
  233.    0x01 check A20 line -- This option forces DOS/4GW to wait until the
  234.         A20 line is enabled before switching to protected mode.  When
  235.         DOS/4GW switches to real mode, this option suspends your
  236.         programs's execution until the A20 line is disabled, unless an
  237.         XMS manager (such as HIMEM.SYS) is active.  If an XMS manager
  238.         is running, your program's execution is suspended until the A20
  239.         line is resotred to the state it had when the CPU was last in
  240.         real mode.  Specify this option if you have a machine that runs
  241.         DOS/4GW but is not truly AT-compatible.  For more information
  242.         on the A20 line, see the section, "Controlling Address Line
  243.         A20" in this chapter.
  244.  
  245.    0x02 prevent initialization of VCPI -- By default, DOS/4GW searches
  246.         for a VCPI server an, if one is prsent, forces it on.  This
  247.         option is useful if your application does not use EMS
  248.         explicitly, is not a resident program, and may be used with
  249.         386-based EMS simulator softawre.
  250.  
  251.    0x04 directly pass down keyboard status calls -- When this option is
  252.         set, status requests are passed down immediately and
  253.         unconditionally.  When disabled, pass-downs are limited so the
  254.         8042 auxiliary processor does not become overloaded by keyboard
  255.         polling loops.
  256.  
  257.    0x10 restore only changed interrupts -- Normally, when a DOS/4GW
  258.         program terminates, all interrupts are restored to the values they
  259.         had at the time of program startup.  When you use this option, only
  260.         the interrupts changed by the DOS/4GW program are restored.
  261.  
  262.    0x20 set new memory to 00 -- WhenDOS/4GW allocates a new segment or
  263.         increases the size of a segment, the memory is zeroed.  This
  264.         can help you find bugs having to do with uninitialized memory.
  265.         You can also use it to provide a consistent working environment
  266.         regardless of what programs were run earlier.  This option only
  267.         affects segment allocations or expansions that are made through
  268.         the DOS/4GW kernel (with DOS function 48h or 4ah).  This option
  269.         does not affect memory allocated with a compiler's malloc
  270.         function.
  271.  
  272.    0x40 set new memory to ff -- When DOS/4GW allocates a new segment or
  273.         increases the size of a segment, the memory is set to 0xff
  274.         bytes.  This is helpful in making reproducible cases of bugs
  275.         caused by using uninitialized memory.  This option only affects
  276.         segment allocations or expansions that are not made through the
  277.         DOS/4GW  kernel (with DOS function 48h or 4ah).  This option
  278.         does not affect memory allocated witha compiler's malloc
  279.         function.
  280.  
  281.    0x80 new selector rotation -- When DOS/4GW allocates a new selector,
  282.         it usually looks for the first available (unused) selector in
  283.         numerical order starting with the highest selector used when
  284.         the program as loaded.  When this option is set, the new
  285.         selector search begins after the last selector that was
  286.         allocated.  This causes new selectors to rotate through the
  287.         range.  Use this option to find references to state selectors,
  288.         ie segments that have been cancelled or freed.
  289.  
  290.  
  291. CONTROLLING ADDRESS LINE 20
  292.  
  293.   This section explains how DOS/4GW uses address line 20 (A20) and
  294.   describes the related DOS16 environment settings.  It is unlikely that
  295.   you will need to use these settings.
  296.  
  297.   Because the 8086 and 8088 chips have 20-bit address spaces, their
  298.   highest addressable memory location is one byte below 1MB.  If you
  299.   specify an address at 1MB or over, which would require a twenty first
  300.   bit to set, the address wraps back to zero.  Some parts of DOS depend
  301.   on this wrap, so on the 286 and 386, the twenty-first address bit is
  302.   disabled.  To address extended memory, DOS/4GW enables the twenty first
  303.   address bit (the A20 line).  The A20 line must be enabled for the CPU
  304.   to run in protected mode, but it may be either enabled or disabled in
  305.   real mode.
  306.  
  307.   By default, when DOS/4GW returns to real mode, it disabled the A20
  308.   line.  Some software depends on the line being enabled.  DOS/4GW
  309.   recognizes the most common software in this class, the XMS managers
  310.   (such as HIMEM.SYS) and enables the A20 line when it returns to real
  311.   mode if an XMS manager is present.  For other software that requires
  312.   the A20 line to be enabled, use the A20 option.  The A20 option makes
  313.   DOS/4GW restore the A20 line to the setting it had when DOS/4GW
  314.   switched to protected mode.  Set the environment variable as follows:
  315.  
  316.       SET DOS16M= A20
  317.  
  318.   To specify more than one option on the command line, seperate the
  319.   options with spaces.
  320.  
  321.   The DOS16M variable also lets you specify the length of delay between a 
  322.   DOS/4GW instruction to change the status of the A20 line and the next 
  323.   DOS/4GW operation.  By default, this delay is 1 loop instruction when 
  324.   DOS/4GW is running on a 386 machine.  In some cases, you may need to 
  325.   specify a longer dleay for a machine that will run DOS/4GW but not 
  326.   truly AT-compatible.  To change the delay, set DO616M to the desired 
  327.   number of loop instructions, preceded by a comma:
  328.  
  329.       SET DOS16M=,loops
  330.  
  331.  
  332.  
  333. ---------------------------------------------------------------------
  334. "VMM"                     (Watcom C/C++32 User's Guide Chapter 20)
  335.  
  336.   The Virtual Memory Manager (VMM) uses a swap file on disk to augment 
  337.   RAM.  With VMM you can use more memory than your machine actually has.  
  338.   When RAM is not sufficient, part of your program is swapped out to the 
  339.   disk file until it is needed again.  The combination of the swap file 
  340.   and available RAM is the virtual memory.
  341.  
  342.   Your program can use VMM is you set the DOS environment variable, 
  343.   DOS4GVM, as follows.  To set the DOS4GVM environment variable, use the 
  344.   format shown below. 
  345.  
  346.     set DOS4GVM= [option#value] [option#value]
  347.  
  348.   The "#" is used with options that take values since the DOS command 
  349.   shell will not accept =
  350.  
  351.   If you set DOS4GVM equal to 1, the default parameters are used for all 
  352.   options.  Example:
  353.  
  354.     set DOS4GVM=1
  355.  
  356.  
  357. VMM DEFAULT PARAMETERS
  358.  
  359. VMM parameters control the options listed below.
  360.  
  361.    MINMEM            The minimum amount of RAM managed by VMM.  The 
  362.                      default is 512KB.
  363.  
  364.    MAXMEM            The maximum amount of RAM managed by VMM.  The 
  365.                      default is 4MB.
  366.  
  367.    SWAPMIN           The minimum or initial size of the swap file.  If 
  368.                      this option is not used, the size of the swap file 
  369.                      is based on VIRTUALSIZE (see below).
  370.  
  371.    SWAPINC           The size by which a swap file grows.
  372.    SWAPNAME          The swap file name.  The default name is 
  373.                      "DOS4GVM.SWP".  By default the file is in the root 
  374.                      directory of the current drive.  Specify the 
  375.                      complete path name if you want to kleep the swap 
  376.                      file somewhere else.
  377.  
  378.    DELETESWAP        Whether the swap file is deleted when the program 
  379.                      exits.  By default the file is not deleted.  
  380.                      Program startup is quicker if the file is not 
  381.                      deleted.
  382.  
  383.    VIRTUALSIZE       The size of the virtual memory space.  The default 
  384.                      is 16MB.
  385.  
  386.  
  387.